builder-tool: Drop unneeded code
authorMatthias Clasen <mclasen@redhat.com>
Sun, 1 Nov 2020 16:14:24 +0000 (11:14 -0500)
committerMatthias Clasen <mclasen@redhat.com>
Mon, 2 Nov 2020 02:23:35 +0000 (21:23 -0500)
We are rewriting the tree before simplifying it,
so there is no need to 'keep things for rewriting'
in the simplify phase.

gtk/tools/gtk-builder-tool-simplify.c

index ec4e8d512985e76ce65501b5f1ae48db07a5b6f4..726c21f649bb954599d8652cf17fc76c7e3cb2b2 100644 (file)
@@ -211,59 +211,6 @@ needs_explicit_setting (GParamSpec *pspec,
   return found;
 }
 
-static gboolean
-keep_for_rewrite (const char *class_name,
-                  const char *property_name,
-                  PropKind kind)
-{
-  struct _Prop {
-    const char *class;
-    const char *property;
-    PropKind kind;
-  } props[] = {
-    { "GtkPopover", "modal", PROP_KIND_OBJECT },
-    { "GtkActionBar", "pack-type", PROP_KIND_PACKING },
-    { "GtkHeaderBar", "pack-type", PROP_KIND_PACKING },
-    { "GtkPopoverMenu", "submenu", PROP_KIND_PACKING },
-    { "GtkToolbar", "expand", PROP_KIND_PACKING },
-    { "GtkToolbar", "homogeneous", PROP_KIND_PACKING },
-    { "GtkPaned", "resize", PROP_KIND_PACKING },
-    { "GtkPaned", "shrink", PROP_KIND_PACKING },
-    { "GtkOverlay", "measure", PROP_KIND_PACKING },
-    { "GtkOverlay", "clip-overlay", PROP_KIND_PACKING },
-    { "GtkGrid", "column", PROP_KIND_PACKING },
-    { "GtkGrid", "row", PROP_KIND_PACKING },
-    { "GtkGrid", "width", PROP_KIND_PACKING },
-    { "GtkGrid", "height", PROP_KIND_PACKING },
-    { "GtkStack", "name", PROP_KIND_PACKING },
-    { "GtkStack", "title", PROP_KIND_PACKING },
-    { "GtkStack", "icon-name", PROP_KIND_PACKING },
-    { "GtkStack", "needs-attention", PROP_KIND_PACKING },
-  };
-  gboolean found;
-  int k;
-  char *canonical_name;
-
-  canonical_name = g_strdup (property_name);
-  g_strdelimit (canonical_name, "_", '-');
-
-  found = FALSE;
-  for (k = 0; k < G_N_ELEMENTS (props); k++)
-    {
-      if (strcmp (class_name, props[k].class) == 0 &&
-          strcmp (canonical_name, props[k].property) == 0 &&
-          kind == props[k].kind)
-        {
-          found = TRUE;
-          break;
-        }
-    }
-
-  g_free (canonical_name);
-
-  return found;
-}
-
 static gboolean
 has_attribute (Element    *elt,
                const char *name,
@@ -657,10 +604,6 @@ property_can_be_omitted (Element      *element,
         property_name = (const char *)element->attribute_values[i];
     }
 
-  if (data->convert3to4 &&
-      keep_for_rewrite (class_name, property_name, kind))
-    return FALSE; /* keep, will be rewritten */
-
   if (translatable)
     return FALSE;